//(function (doc, win) {
//  var docEl = doc.documentElement,
//      resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
//      recalc = function () {
//          var clientWidth = docEl.clientWidth;
//          if (!clientWidth) return;
//          docEl.style.fontSize = 100 * (clientWidth / 375) + 'px';
//      };
//
//  if (!doc.addEventListener) return;
//  win.addEventListener(resizeEvt, recalc, false);
//  doc.addEventListener('DOMContentLoaded', recalc, false);
//})(document, window);
document.documentElement.style.fontSize = document.documentElement.clientWidth / 375 * 100 + 'px';
function getUrlParam(name) {
    var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)'); 
    var r = window.location.search.substr(1).match(reg); 
    if (r != null) return unescape(r[2]);
    return null; 
}

function getQueryString(key) {
    var reg = new RegExp('(^|&)' + key + '=([^&]*)(&|$)');
    var result = window.location.search.substr(1).match(reg);
    return result ? decodeURIComponent(result[2]) : null;
}


var base_url = 'http://www.yunnantese.com/';
// var base_url = 'http://192.168.1.111:8090/';
// var base_url = 'http://192.168.1.106:8080/';

let u_id = 14;
// let u_id = window.sessionStorage.getItem('u_id');

let s_id = 1;
// let s_id = window.sessionStorage.getItem('s_id');

//微信中的隐藏分享按钮
//$('head').append($('<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>'))
window.onload = function(){
	$('<script src="../js/share.js" type="text/javascript"></script>').appendTo($('body'))
}
var head= document.getElementsByTagName('head')[0]; 
var script= document.createElement('script'); 
script.type= 'text/javascript'; 
script.src= 'http://res.wx.qq.com/open/js/jweixin-1.0.0.js'; 
head.appendChild(script); 
function changeTime1(shijian,date1) { //把传进来的毫秒数装换成字符串类型然后输出,如果不传或者time怎返回具体时间,date怎返回日期,all返回全部的日期时间
	var show = new Date(Number(shijian));
	var year = show.getFullYear();
	var month = (show.getMonth() + 1) < 10 ? '0' + (show.getMonth() + 1) : show.getMonth() + 1
	var day = show.getDate() < 10 ? '0' + show.getDate() : show.getDate();
	var hour = show.getHours() < 10 ? '0' + show.getHours() : show.getHours();
	var minutes = show.getMinutes() < 10 ? '0' + show.getMinutes() : show.getMinutes();
	var seconds = show.getSeconds() < 10 ? '0' + show.getSeconds() : show.getSeconds();
	var stringdata =  hour + ':' + minutes + ':' + seconds + ' ';
	var stringdata2 = year+'-'+month+'-'+day+' '+hour + ':' + minutes + ':' + seconds;
	var stringdata3 = year+'-'+month+'-'+day;
	if(date1==''||date1==undefined||date1==null||date1=='time'){
		return stringdata
	}else if(date1=='all'){
		return stringdata2;
	}else if(date1=='date'){
		return stringdata3;
	}else{
		return '请检查你的第二个参数,O(∩_∩)O谢谢!';
	}
}